

# 类对象转字典
def obj2dict(o):
    temp = dir(o)
    attrs = []
    for a in temp:
        if '__' not in a:
            attrs.append(a)
    o_dict = {}
    for a in attrs:
        o_dict[a] = o.__getattribute__(a)
    return o_dict
